<template>
    <div>
        <h4 class="tagTitle">推荐</h4>
        <ul class="list-unstyled">
            <li class="media" v-for="item in randHotBookList">
                <div class="media-body">
                    <h5 class="mt-0 mb-1 title" @click="goDetail(item.id)">{{ item.name }}</h5>
                    <p class="text-ellipsis infoCss">{{ item.info }}</p>
                </div>
            </li>
        </ul>
    </div>
</template>

<script>
import { ref } from "vue"
export default {
    props: {
        randHotBookList: {
            type: Array
        }
    },
    methods:{
        goDetail(id) {
            this.$router.push({ path: '/home/homeBookDetail', query: { id: id } })
        },
    }
}
</script>

<style scoped>
/* @import url(); 引入css类 */
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.infoCss {
    color: #444446d3;
    transform: scale(0.9);
}

.title {
    font-family: "Times New Roman", Times, serif;
    font-weight: 500;
}

.title:hover {
    cursor: pointer;
    transform: scale(1.1);
}
</style>